今天來解YKL04(UVA10071):Back to High School Physics 和 YKL05(UVA11150):Cola

重點 double of that time
2 * v * t
#include <iostream>
using namespace std;
int main(){
	int v,t;
	while(cin >> v >> t){
		cout << 2 * v * t << endl;
	}
	return 0;
}


一種是不借空瓶,另一種是借空瓶,然後取兩者中的最大值。
-先記錄購買的coke數量
-兌換:空瓶大於3個時
用空瓶兌換coke(3個空瓶換1瓶新的coke)
更新喝到的coke數量
更新空瓶數量(喝完新的coke加上剩下的空瓶)
-借瓶:
當空瓶數剩下2時,向別人借1個空瓶,並換一瓶新的,最後更還
#include <iostream>
using namespace std;
int main(){
    int n;
    while (cin >> n) {
        int total = n;    
        int empty = n;    
        while (empty >= 3) {
            int newCola = empty / 3;  
            total += newCola;         
            empty = empty % 3 + newCola;  
        }
        if (empty == 2) {
            total++;
        }
        cout << total << endl; 
    }
    return 0;
}
#include <iostream>
using namespace std;
int main(){
    int n;
    while(cin >> n){
        cout << n + n / 2 << endl;
    }
    return 0;
}